﻿
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using Model;
using MsDAL;
using System.ComponentModel;

namespace ServiceHelper
{
   [DataObjectAttribute]
   public  partial  class Bas1a41Base
    {
		protected  Bas1a41DAL bas1a41Dal = new Bas1a41DAL();
      			
		/// <summary>
        /// 增加一条数据
        /// </summary>
        public virtual SqlApp Add(Model.Bas1a41 bas1a41)
        {
			return bas1a41Dal.Add( bas1a41);
        }

		
        /// <summary>
        /// 判断某个值是否存在表中的某个字段
        /// </summary>
        /// <param name="Condition">条件字段名 例:A=@A</param>
        /// <param name="hs">参数和值 如hs["@A"]=123</param>
        /// <returns></returns>
        public virtual bool Exists(String condition, Hashtable hs)
   		{
			return bas1a41Dal.Exists( condition, hs);		
        }
		
		/// <summary>
        /// 更新一条数据
        /// </summary>
        public virtual SqlApp Update(Model.Bas1a41 bas1a41)
        {
			return bas1a41Dal.Update(bas1a41);		
		}
		
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public virtual SqlApp Delete(Model.Bas1a41 bas1a41)
        {
			return bas1a41Dal.Delete(bas1a41);		
		}
		
		/// <summary>
        /// 根据Listid得到整个 Bas1a41对象,如果没查到，返回null
        /// </summary>
        /// <param name="Listid">该实体主键 Listid</param>
        /// <returns>实体Bas1a41的对象</returns>
		public virtual Model.Bas1a41 GetModelById(string Listid)
        {
			return bas1a41Dal.GetModelById( Listid);		        
        }
		

        /// <summary>
        /// 根据条件和参数得到Bas1a41对象
        /// </summary>
        /// <param name="Condition">Sql条件</param>
        /// <param name="hs">参数和值</param>
        /// <returns></returns>
        public virtual Model.Bas1a41 GetModel(String Condition, Hashtable hs)
        {
			return bas1a41Dal.GetModel(Condition,hs);
        }

		/// <summary>
        /// 根据主键的值和某字段得到其值,可以用来判断是否存在
        /// </summary>
        /// <param name="TableKeyValue">主键值</param>
        /// <param name="FieldName">要查询的字段名称</param>
        /// <returns></returns>
        public virtual Object GetValueByField(Object TableKeyValue, Object FieldName)
        {
			return bas1a41Dal.GetValueByField(TableKeyValue,FieldName);
        }
		
		
		public virtual ReturnPageData GetList(Pager page)
		{
			return bas1a41Dal.GetList(page);
		}
		
		public virtual DataTable GetList(string condition,Hashtable hs)
		{
			return bas1a41Dal.GetList(condition, hs);
		}		
    }
}